<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Java远程调试完全指南</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        }
        .code-block {
            background: #1e1e1e;
            color: #d4d4d4;
            border-radius: 8px;
            padding: 1.5rem;
            overflow-x: auto;
            font-family: 'Consolas', 'Monaco', monospace;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        }
        .step-number {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
        }
        .parameter-card {
            background: white;
            border-left: 4px solid #667eea;
            padding: 1rem 1.5rem;
            margin-bottom: 1rem;
            border-radius: 0 8px 8px 0;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
            transition: all 0.3s ease;
        }
        .parameter-card:hover {
            box-shadow: 0 5px 20px rgba(0,0,0,0.1);
            transform: translateX(5px);
        }
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 2rem 0;
        }
        .highlight-text {
            background: linear-gradient(to right, #667eea, #764ba2);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            font-weight: 600;
        }
        .image-container {
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0,0,0,0.15);
            margin: 1.5rem 0;
        }
        .image-container img {
            width: 100%;
            height: auto;
            display: block;
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <div class="hero-gradient text-white py-20">
        <div class="container mx-auto px-6">
            <div class="text-center">
                <h1 class="text-5xl font-bold mb-4">Java远程调试完全指南</h1>
                <p class="text-xl opacity-90 max-w-2xl mx-auto">掌握生产环境调试技巧，让问题无处遁形</p>
                <div class="mt-8 flex justify-center space-x-4">
                    <div class="bg-white bg-opacity-20 rounded-full px-6 py-2 backdrop-blur-sm">
                        <i class="fas fa-bug mr-2"></i>远程调试
                    </div>
                    <div class="bg-white bg-opacity-20 rounded-full px-6 py-2 backdrop-blur-sm">
                        <i class="fas fa-server mr-2"></i>服务器部署
                    </div>
                    <div class="bg-white bg-opacity-20 rounded-full px-6 py-2 backdrop-blur-sm">
                        <i class="fas fa-code mr-2"></i>IDEA配置
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Main Content -->
    <div class="container mx-auto px-6 py-12">
        <!-- 流程概览 -->
        <div class="bg-white rounded-2xl shadow-xl p-8 mb-12 card-hover">
            <h2 class="text-3xl font-bold mb-6 text-gray-800">
                <i class="fas fa-route mr-3 text-purple-600"></i>调试流程概览
            </h2>
            <div class="mermaid">
                graph LR
                    A[打包JAR文件] --> B[上传到服务器]
                    B --> C[启动调试服务]
                    C --> D[配置IDEA远程连接]
                    D --> E[开始调试]
                    
                    style A fill:#667eea,stroke:#fff,stroke-width:2px,color:#fff
                    style B fill:#7c3aed,stroke:#fff,stroke-width:2px,color:#fff
                    style C fill:#8b5cf6,stroke:#fff,stroke-width:2px,color:#fff
                    style D fill:#a78bfa,stroke:#fff,stroke-width:2px,color:#fff
                    style E fill:#c4b5fd,stroke:#fff,stroke-width:2px,color:#fff
            </div>
        </div>

        <!-- 步骤详解 -->
        <div class="grid gap-8">
            <!-- 步骤1 -->
            <div class="bg-white rounded-2xl shadow-xl p-8 card-hover">
                <div class="flex items-start mb-6">
                    <div class="step-number mr-4">1</div>
                    <h3 class="text-2xl font-bold text-gray-800">上传JAR包到服务器</h3>
                </div>
                <p class="text-gray-600 mb-4 text-lg">首先需要将本地打包好的JAR文件上传到目标服务器。确保服务器环境已经配置好Java运行环境。</p>
                <div class="image-container">
                    <img src="https://cdn.nlark.com/yuque/0/2023/png/21449790/1681039021139-49928ba8-a3bc-4f79-b949-1f4efa414bc2.png" alt="上传JAR包">
                </div>
            </div>

            <!-- 步骤2 -->
            <div class="bg-white rounded-2xl shadow-xl p-8 card-hover">
                <div class="flex items-start mb-6">
                    <div class="step-number mr-4">2</div>
                    <h3 class="text-2xl font-bold text-gray-800">启动调试服务</h3>
                </div>
                <p class="text-gray-600 mb-6 text-lg">使用特定的JVM参数启动Java应用，开启远程调试功能：</p>
                <div class="code-block">
                    <code>java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888 -jar user-crud.jar</code>
                </div>
                <div class="mt-6 bg-yellow-50 border-l-4 border-yellow-400 p-4 rounded">
                    <p class="text-yellow-800">
                        <i class="fas fa-exclamation-triangle mr-2"></i>
                        <strong>注意：</strong>服务端口（8080）和调试端口（8888）必须不同，且调试端口需要在防火墙中开放。
                    </p>
                </div>
                <div class="image-container mt-6">
                    <img src="https://cdn.nlark.com/yuque/0/2023/png/21449790/1681039215908-6fd3786b-8689-493c-a36a-e485f8dae85a.png" alt="启动调试服务">
                </div>
            </div>

            <!-- 参数说明 -->
            <div class="bg-white rounded-2xl shadow-xl p-8">
                <h3 class="text-2xl font-bold text-gray-800 mb-6">
                    <i class="fas fa-cog mr-3 text-purple-600"></i>调试参数详解
                </h3>
                
                <div class="parameter-card">
                    <h4 class="font-bold text-purple-700 mb-2">transport</h4>
                    <p class="text-gray-600">指定调试通信协议：</p>
                    <ul class="mt-2 ml-4 text-gray-600">
                        <li><code class="bg-gray-100 px-2 py-1 rounded">dt_socket</code> - Socket方式连接（推荐）</li>
                        <li><code class="bg-gray-100 px-2 py-1 rounded">dt_shmem</code> - 共享内存方式（仅Windows）</li>
                    </ul>
                </div>

                <div class="parameter-card">
                    <h4 class="font-bold text-purple-700 mb-2">server</h4>
                    <p class="text-gray-600">指定应用角色，设置为 <code class="bg-gray-100 px-2 py-1 rounded">y</code> 表示作为调试服务端</p>
                </div>

                <div class="parameter-card">
                    <h4 class="font-bold text-purple-700 mb-2">suspend</h4>
                    <p class="text-gray-600">是否在启动时阻塞等待连接，通常设置为 <code class="bg-gray-100 px-2 py-1 rounded">n</code></p>
                </div>

                <div class="parameter-card">
                    <h4 class="font-bold text-purple-700 mb-2">address</h4>
                    <p class="text-gray-600">调试连接端口，<span class="highlight-text">必须与应用端口不同</span></p>
                </div>

                <!-- 命令示例 -->
                <div class="mt-8">
                    <h4 class="text-xl font-bold text-gray-800 mb-4">
                        <i class="fas fa-terminal mr-2 text-purple-600"></i>常用命令示例
                    </h4>
                    <div class="space-y-4">
                        <div class="bg-gray-50 p-4 rounded-lg">
                            <code class="text-sm">-agentlib:jdwp=transport=dt_socket,server=y,address=8000</code>
                            <p class="text-gray-600 mt-2 text-sm">监听8000端口，启动时阻塞等待连接</p>
                        </div>
                        <div class="bg-gray-50 p-4 rounded-lg">
                            <code class="text-sm">-agentlib:jdwp=transport=dt_socket,server=y,address=localhost:8000,timeout=5000</code>
                            <p class="text-gray-600 mt-2 text-sm">监听8000端口，5秒内无连接则超时</p>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 步骤3 -->
            <div class="bg-white rounded-2xl shadow-xl p-8 card-hover">
                <div class="flex items-start mb-6">
                    <div class="step-number mr-4">3</div>
                    <h3 class="text-2xl font-bold text-gray-800">配置IDEA远程调试</h3>
                </div>
                
                <div class="grid md:grid-cols-2 gap-6">
                    <div>
                        <h4 class="font-bold text-gray-700 mb-3">
                            <i class="fas fa-plus-circle mr-2 text-purple-600"></i>新建远程连接
                        </h4>
                        <div class="image-container">
                            <img src="https://cdn.nlark.com/yuque/0/2023/png/21449790/1681039264635-77dcbd51-a054-42e1-be9b-a4185a52715e.png" alt="新建远程连接">
                        </div>
                    </div>
                    
                    <div>
                        <h4 class="font-bold text-gray-700 mb-3">
                            <i class="fas fa-sliders-h mr-2 text-purple-600"></i>配置连接参数
                        </h4>
                        <ul class="space-y-2 text-gray-600">
                            <li><i class="fas fa-check text-green-500 mr-2"></i>设置服务器IP地址</li>
                            <li><i class="fas fa-check text-green-500 mr-2"></i>填写调试端口（8888）</li>
                            <li><i class="fas fa-check text-green-500 mr-2"></i>选择对应的模块</li>
                        </ul>
                    </div>
                </div>
                
                <div class="image-container mt-6">
                    <img src="https://cdn.nlark.com/yuque/0/2023/png/21449790/1681039330210-e1e6b826-f672-4369-a465-edf18d471605.png" alt="远程参数配置">
                </div>
            </div>

            <!-- 测试效果 -->
            <div class="bg-white rounded-2xl shadow-xl p-8">
                <h3 class="text-2xl font-bold text-gray-800 mb-6">
                    <i class="fas fa-play-circle mr-3 text-purple-600"></i>启动调试与测试
                </h3>
                
                <div class="mb-6">
                    <h4 class="font-bold text-gray-700 